import Axios from 'axios'
import {get,post} from './http'

//判断管理员是否登陆成功
export const getLoginStatus = params => post(`admin/login`,params)

//==========用户相关==========
//添加用户
export const setConsumer = params => post(`consumer/add`,params)
//修改用户
export const updateConsumer = params => post(`consumer/update`,params)
//删除用户
export const delConsumer = id => get(`consumer/delete?id=${id}`)
//获取用户信息
export const getConsumerOfId = id => get(`consumer/getById?id=${id}`)
//获取所有用户信息
export const getAllConsumer = () => get(`consumer/allConsumer2`)

//==========视频相关==========
//添加视频
export const setVideo = params => post(`video/add`,params)
//修改视频
export const updateVideo = params => post(`video/update`,params)
//删除视频
export const delVideo = id => get(`video/delete?id=${id}`)
//获取所有视频信息
export const getAllVideo = () => get(`video/allVideo`)
//根据id获取视频信息
export const getVideoById = (id) => get(`video/getById?id=${id}`)
//根据id获取视频中的弹幕信息
export const getBarrageById = (id) => get(`video/getBarrageById?id=${id}`)
//根据详细信息删除弹幕
export const delBarrage = (params) => post(`video/delBarrage`,params)
//所有热门视频信息
export const getAllHotVideo = () => get(`hotVideo/allHotVideo`)
//修改视频
export const updateHotVideo = params => post(`hotVideo/update`,params)

//========审核视频相关=========
//获取所有视频信息
export const getAllUnCheckVideo = () => get(`unCheckVideo/allVideo`)
//审核通过
export const addToVideo = id => get(`unCheckVideo/addToVideo?id=${id}`)
//审核不通过
export const refuseVideo = params => post(`unCheckVideo/refuse`,params)

//========评论相关=========
//根据评论内容关键字模糊搜索
export const getByContent = content => get(`comment/getByContent?content=${content}`)
//删除评论
export const delComment = id => get(`comment/delete?id=${id}`)